package com.design.pattern.mediator;

public class Client {
    public static void main(String[] args) {
        /**
         * 老板们
         */
        MeatBoss meat=new MeatBoss("肉店","生肉");
        DishBoss dishBoss=new DishBoss("菜店","菜");
        MeterBoss meterBoss=new MeterBoss("米店","米");
        GreaseBoss greaseBoss=new GreaseBoss("油店","油");
        /**
         * 去平台注册
         */
        Intermediary intermediary=new ConcreteIntermediary(dishBoss,meterBoss,meat,greaseBoss);
        //银子
        Silver silver=new Silver();
        silver.setNumber(1);
        //买吃的
        meat.buy(silver,intermediary);
        dishBoss.buy(silver,intermediary);
        meterBoss.buy(silver,intermediary);
        greaseBoss.buy(silver,intermediary);
    }
}
